#include "pm_project_impl.hpp"
#include "pm_flow_impl.hpp"

/*---------------------------------------------------------------------------*/

namespace ProjectManager {

/*---------------------------------------------------------------------------*/


ProjectImpl::ProjectImpl( const std::string& _name )
	:	m_name( _name )
{
}


/*---------------------------------------------------------------------------*/


ProjectImpl::~ProjectImpl()
{
	for( int i = 0; i < m_flows.size(); ++i )
		delete m_flows[i];
}


/*---------------------------------------------------------------------------*/


const std::string&
ProjectImpl::getName() const
{
	return m_name;
}


/*---------------------------------------------------------------------------*/


void
ProjectImpl::setName( const std::string& _name )
{
	m_name = _name;
}


/*---------------------------------------------------------------------------*/


Flow&
ProjectImpl::createFlow( const std::string& _name )
{
	m_flows.push_back( new FlowImpl(_name ) );
	return *m_flows.back();
}


/*---------------------------------------------------------------------------*/


int
ProjectImpl::getFlowsCount() const
{
	return m_flows.size();
}


/*---------------------------------------------------------------------------*/


const Flow&
ProjectImpl::getFlow( int _idx ) const
{
	return *m_flows.at( _idx );
}


/*---------------------------------------------------------------------------*/

} // namespace ProjectManager
